<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include/header_css::header('')"></head>
<body>
<div id="dpLTE" class="container-fluid" v-cloak>
	<div class="row">
		<div class="col-md-4 form-inline pull-left">
			<div class="form-group">
		    	<input v-model.trim="keyword.key" @keyup.enter="load" type="text" class="form-control"
                       placeholder="请输入标题、副标题、摘要"
                       style="width: 220px;" />
			</div>
			<div class="form-group">
			    <a class="btn btn-primary" @click="load"><i class="fa fa-search"></i>&nbsp;查询</a>
			</div>
		</div>
	</div>
	<div class="row">
        <!--table-condensed 表格紧凑-->
		<table id="dataGrid" class="table-condensed"></table>
	</div>
</div>
<div th:include="include/footer_js::footer"></div>
<script type="application/javascript">
    /**
     * js
     */
    $(function () {
        initialPage();
        getGrid();
    });

    function initialPage() {
        $(window).resize(function() {
            $('#dataGrid').bootstrapTable('resetView', {height: $(window).height()-54});
        });
    }

    function getGrid() {
        $('#dataGrid').bootstrapTableEx({
            url: '../../srblive/courses/list?_' + $.now(),
            height: $(window).height()-54,
            queryParams: function(params){
                params.keyword = vm.keyword;
                return params;
            },
            singleSelect: true,
            columns: [
                {checkbox: true},
                {field : "title", title : "标题", width : "100px"},
                {field : "subtitle", title : "副标题", width : "100px"},
                {field : "summary", title : "摘要", width : "100px"},
                {field : "status", title : "状态", width : "100px",
                    formatter: function (value, row, index) {
                        return Utils.commonFmt(value,row,index,conts.liveXcxCourses.status,"上架状态");
                    }
                },
//                {field : "series", title : "课程类型", width : "100px"},
//                {field : "sort", title : "排序序号", width : "100px"},
//                {field : "zan", title : "点赞数量", width : "100px"},
//                {field : "collect", title : "收藏数量", width : "100px"},
//                {field : "views", title : "浏览数量", width : "100px"},
            ]
        })
    }

    var vm = new Vue({
        el:'#dpLTE',
        data: {
            keyword: {
                key:null
            }
        },
        methods : {
            load: function() {
                $('#dataGrid').bootstrapTable('refresh');
            },
            acceptClick:function (iframeId) {
                var ck = $('#dataGrid').bootstrapTable('getSelections');
                if (checkedRow(ck)) {
                    top.frames[iframeId].vm.liveXcxCourses.seriesid = ck[0].cid;
                    top.frames[iframeId].vm.series.title = ck[0].title;
                    dialogClose();
                }
            }
        }
    })

</script>
</body>
</html>